package com.hy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hy.domain.Hotel;

@Controller
public class NewHotelController {
	
	@RequestMapping("/hotel/view/{id}")
	public String view(@PathVariable long id, Model model) {
		Hotel hotel = Hotel.findHotel(id);
		model.addAttribute("hotel", hotel);
		model.addAttribute("prev", hotel.prev());
		model.addAttribute("next", hotel.next());
		return "hotel_xq";
	}
}
